package com.zzq.calcgame.storage;

/**
 * Created by android on 16/9/29.
 */

public class CCDb {

    public static abstract class PaperTable{

        public static final String  TABLE_NAME="paper";

        public static final String ID="id";

        public static final String CREATE_TIME="create_time";

        public static final String TOTAL_SCORE="total_score";

        public static final String WRONG_COUNT="wrong_count";

        public static final String QUESTION_COUNT="question_count";

        public static final String CREATE="CREATE TABLE "
                + TABLE_NAME
                +"("
                + ID +" INTEGER PRIMARY KEY AUTOINCREMENT,"
                + CREATE_TIME + " TEXT ,"
                + TOTAL_SCORE +" INTEGER,"
                + WRONG_COUNT +" INTEGER,"
                + QUESTION_COUNT +" INTEGER)";
    }

    public static abstract class QuestionTable{

        public static final String TABLE_NAME="question";

        public static final String ID="id";

        public static  final String PAPER_ID="paper_id";

        public static  final String NUMBER_1="number_1";

        public static  final String NUMBER_2="number_2";

        public static  final String OPERATOR="operator";

        public static  final String ANSWER="answer";

        public static final String CREATE ="CREATE TABLE "
                +TABLE_NAME
                +"("
                +ID +" INTEGER PRIMARY KEY AUTOINCREMENT,"
                +PAPER_ID + " INTEGER,"
                +NUMBER_1 + " TEXT,"
                +NUMBER_2 +" TEXT,"
                +ANSWER +" TEXT,"
                +OPERATOR+ " INTEGER,"
                +"FOREIGN KEY("+PAPER_ID+") REFERENCES " +PaperTable.TABLE_NAME+"("+PaperTable.ID+")"
                +");";

    }
}
